package java68_5;

import java.util.Scanner;

public class SuperMaetTest {
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int ch=0;
        SuperMaret sm=new SuperMaret();

        while(true){
            System.out.println("1:增加新会员\n2:查看会员信息\n3:查找会员积分\n9:退出");
            ch=in.nextInt();
            if(ch==1){
                System.out.println("输入卡号和积分:");
                Vip v=new Vip();
                v.cardNo=in.next();
                v.score=in.nextInt();
                sm.add(v);
            }else if(ch==2){
                sm.showVipsInfo();
            }else if(ch==3){
                System.out.print("请输入卡号:");
                Vip result=sm.search(in.next());
                if(result==null){
                    System.out.println("没有这个会员");
                }else{
                    System.out.println("此会员的积分是:"+result.score);
                }
            }else if(ch==9){
                break;
            }
        }
    }
}
